from TurtleWorld import *


from math import *
 
world=TurtleWorld()
roger=Turtle()
roger.delay = 0.01

 
#----------------------------TRIANGLES----------------------------#

def equilateral_tri(t, size=100, rotate=0):
    print "Equilateral Triangle, with Size:", size, "and Rotation:", rotate
    t.lt(rotate)
    for i in range(3):
        t.fd(size)
        t.lt(120)
    t.rt(rotate)

roger.pu()
roger.rt(90)
roger.fd(30)
roger.pd()
 
equilateral_tri(roger, 100, 100)
#--------------------------QUADRILATERALS-------------------------#
def rhombus(t, size=100, angle=120, rotate=0):
    print "Rhombus, with size:", size, "Angle:", angle, "and Rotation:", rotate
    for i in range (8):
        t.fd(size)
        t.rt(angle)
        t.fd(size)
        t.rt(angle/2)
        
def para(t, size=100, width=100, angle=120, rotate=0 , height=80):
    print "Parallelogram, with Width:", width, "Height:", height, "Angle:", angle, "and Rotation:", rotate
       
    t.lt(rotate)
    for i in range (8):
        t.fd(size)
        t.rt(angle)
        t.fd(size)
        t.rt(180-angle)
    t.rt(rotate)

    
def rhom(t, size=100, angle=120, rotate=0):
    print "Rhombus, with Size:", size, "Angle:", angle, "and Rotation:", rotate
    t.lt(rotate)
    for i in range (8):
        t.fd(size)
        t.rt(angle)
        t.fd(size)
        t.rt(angle/2)

def rect(t, width=100, height=100, rotate=0):
    print "Rectangle, with Width:", width, "Height:", height, "and Rotation:", rotate
    t.lt(rotate)
    for i in range (8):
        t.fd(size)
        t.rt(angle)
        t.fd(size)
        t.rt(angle/2)

def square(t, size=100, rotate=0):
    print "Sqaure, with Size:", size, "and Rotation:", rotate
    lt.(rotate)
    for i in range(4)
        t.fd(size)
        t.lt(90)
    t.rt(rotate)
    
roger.pu()
roger.rt(90)
roger.fd(30)
roger.pd()
 
 
    
#------------------------------MOVEMENT---------------------------#

def line(t, x=100, y=100):
    print "Line to a point X:", x, "over and Y:", y, "up"
    
    dist= sqrst(x**2 + y**2)
    angle= degrees(atan(y/float(x)))
    t.lt(angle)
    t.fd(dist)
    t.rt(angle)

  
def move(t, x, y):
    print "Move without marking to a point X:", x, "over and Y:", y, "up"
      
#------------------------------OTHER SHAPES------------------------#
"""
Build any other shape functions you want.
Some Ideas:
    Right Triangles (sss, sas, etc)
    Arbitrary Triangles
    Circle
    Arcs
    Go Wild!
    
Bonus for working or challenging functions...no penalty for trying something
"""

#------------------------------TEST-------------------------------#

square(roger)
para(roger)
rhombus(roger)
wait_for_user()